import request from '../utils/request.js';
import request1 from '../utils/request1.js';
//添加购物车
export function addShoppingTrolley(data){
	return request({
		url:'/salesOrder/addShoppingTrolley',
		method:'POST',
		data,
	})
}
//提交订单
export function saveSalesOrder(data){
	return request({
		url:'/salesOrder/saveSalesOrder',
		method:'POST',
		data,
	})
}
//提交收款表
export function saveReceipts(data){
	return request({
		url:'/collection/saveReceipts',
		method:'POST',
		data,
	})
}
//回写收款订单
export function rewriteReceipts(data){
	return request({
		url:'/collection/rewriteReceipts',
		method:'POST',
		data,
	})
}
//再次拉起支付
export function restartWeChatPay({Collection_SerialNumber,OpenId}){
	return request({
		url:`/collection/restartWeChatPay?Collection_SerialNumber=${Collection_SerialNumber}&OpenId=${OpenId}`,
		method:'GET',
	})
}
//查询积分信息
export function getUserSalesOrderDetailByActivity({Open_ID}){
	return request({
		url:`/salesOrder/getUserSalesOrderDetailByActivity?OpenId=${Open_ID}`,
		method:'GET',
	})
}
//订单查询
export function getUserSalesOrderList({Open_ID,RowAmount,PageNubmer,Status}){
	return request({
		url:`/salesOrder/getUserSalesOrderList?OpenId=${Open_ID}&RowAmount=${RowAmount}&PageNubmer=${PageNubmer}&Status=${Status}`,
		method:'GET',
	})
}
//销售订单获取某一条
export function getUserSalesOrderListBySalesOrderSerialNumber({OpenId,SalesOrderSerialNumber}){
	return request({
		url:`/salesOrder/getUserSalesOrderListBySalesOrderSerialNumber?OpenId=${OpenId}&SalesOrderSerialNumber=${SalesOrderSerialNumber}`,
		method:'GET'
	})
}
//取消订单
export function cancelRewriteReceiptsByCollectionSerialNumber(data){
	return request({
		url:`/collection/cancelRewriteReceiptsByCollectionSerialNumber`,
		method:'POST',
		data
	})
}
//退款
export function saveRefunds(data){
	return request({
		url:`/collection/saveRefunds`,
		method:'POST',
		data
	})
}
//查询物流信息
export function getWayBillStatus(data){
	return request1({
		url:`/getWayBillStatus?grant_type=tourist`,
		method:'GET',
		data
	})
}
